Skip to content

feat: include entity coords if entity is defined #203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 25, 2024
Merged

feat: include entity coords if entity is defined #203

merged 3 commits into from
Jul 25, 2024

Conversation

Z3rio
Copy link
Contributor

@Z3rio Z3rio commented May 25, 2024

Describe Pull request
This PR makes sure that the coordinates of said entity are included in the data passed upon trigger events.
This is useful as you can't fetch these coordinateson the server side.

This solves an issue in the inventory, where the vending machines are defined via AddTargetModel.
https://github.com/qbcore-framework/qb-inventory/blob/ed5388d2430cbd24d187b984bd827c4f38425a9c/client/main.lua#L274-L286
To later be used via a server event, which requires the coordinates, but are undefined/null at the moment as there's no way of fetching them.
https://github.com/qbcore-framework/qb-inventory/blob/ed5388d2430cbd24d187b984bd827c4f38425a9c/server/main.lua#L142

This needs to be merged alongside this PR:
qbcore-framework/qb-inventory#518

Questions (please complete the following information):

  • Have you personally loaded this code into an updated qbcore project and checked all its functionality?

yes

  • Does your code fit the style guidelines?

yes

  • Does your PR fit the contribution guidelines?

yes

@Z3rio
Copy link
Contributor Author

Z3rio commented May 25, 2024

I moved the logic for fetching the coords to right before triggering the event, as the prop might have moved since its definition.
Aswell as the fact that I'm a bit unsure if you can really fetch the coords of all props as some of them might be deloaded due to distance.

@GhzGarage GhzGarage merged commit 70b7ba8 into qbcore-framework:main Jul 25, 2024
2 checks passed
ItzMuri added a commit to ItzMuri/qb-target that referenced this pull request Oct 25, 2024
feat: include entity coords if entity is defined (qbcore-framework#203)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants